VT-d: remove useless variables
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Jun 2009 08:26:39 +0000 (09:26 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Jun 2009 08:26:39 +0000 (09:26 +0100)
This patch removes global variable "vtd_enabled", which is
redundant. "iommu_enabled" is enough. And also removes useless global
variables qi_ctrl and ir_ctrl, which are not used at all.

Signed-off-by: Weidong Han <weidong.han@intel.com>
xen/arch/x86/msi.c
xen/drivers/passthrough/vtd/dmar.c
xen/drivers/passthrough/vtd/extern.h
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/utils.c
xen/drivers/passthrough/vtd/x86/vtd.c
xen/include/xen/iommu.h

index 1587df385a64ee9d6ace8102ec3cb398ad05b0c7..2de803d6d0b4186b26c083fe833ce4649db33866 100644 (file)
@@ -191,7 +191,7 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         BUG();
     }
 
-    if ( vtd_enabled )
+    if ( iommu_enabled )
         msi_msg_read_remap_rte(entry, msg);
 }
 
index 903e48d320068e83c364bf4f0e57078a5a45e073..68881bc121b4f04fbda4f8b5249f26f4ad0daf86 100644 (file)
@@ -32,8 +32,6 @@
 #include "dmar.h"
 #include "iommu.h"
 
-int vtd_enabled = 1;
-
 #undef PREFIX
 #define PREFIX VTDPREFIX "ACPI DMAR:"
 #define DEBUG
@@ -561,6 +559,6 @@ int acpi_dmar_init(void)
         panic("acpi_dmar_init: acpi_dmar_init failed,"
               " crash Xen for security purpose!\n");
 
-    vtd_enabled = 0;
+    iommu_enabled = 0;
     return -ENODEV;
 }
index 0a20d34ac8765c93b4e85c06ffbd520e0333a3e6..dadd5517f11482e8b21a1aa35be9b6c4d68d4a3a 100644 (file)
@@ -25,8 +25,6 @@
 
 extern int qinval_enabled;
 extern int ats_enabled;
-extern struct qi_ctrl *qi_ctrl;
-extern struct ir_ctrl *ir_ctrl;
 
 void print_iommu_regs(struct acpi_drhd_unit *drhd);
 void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn);
index 4826a1ae45a00a0078835cea96afbb75617bec7f..50e801fe6916650a9bb8bfef076ccfd56c6acb79 100644 (file)
@@ -1790,7 +1790,7 @@ int intel_vtd_setup(void)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
 
-    if ( !vtd_enabled )
+    if ( !iommu_enabled )
         return -ENODEV;
 
     platform_quirks();
@@ -1859,7 +1859,7 @@ int intel_vtd_setup(void)
  error:
     for_each_drhd_unit ( drhd )
         iommu_free(drhd);
-    vtd_enabled = 0;
+    iommu_enabled = 0;
     iommu_snoop = 0;
     iommu_passthrough = 0;
     iommu_qinval = 0;
@@ -1955,7 +1955,7 @@ void iommu_suspend(void)
     struct iommu *iommu;
     u32    i;
 
-    if ( !vtd_enabled )
+    if ( !iommu_enabled )
         return;
 
     iommu_flush_all();
@@ -1991,7 +1991,7 @@ void iommu_resume(void)
     struct iommu_flush *flush;
     u32 i;
 
-    if ( !vtd_enabled )
+    if ( !iommu_enabled )
         return;
 
     /* Re-initialize the register-based flush functions.
index c720030c0a1921f6d1e22257321fe55ed0ea6e42..9854d146711d7ef45aca94f9ab7cb22ce24daf72 100644 (file)
@@ -260,7 +260,7 @@ void dump_iommu_info(unsigned char key)
     }
 
     /* Dump the I/O xAPIC redirection table(s). */
-    if ( vtd_enabled )
+    if ( iommu_enabled )
     {
         int apic, reg;
         union IO_APIC_reg_01 reg_01;
index c41e38a3f3686f793782d1f55bf124d5fb219331..7c2c80134daeeade6b9d10d6bfc0298826ca2a4d 100644 (file)
@@ -117,7 +117,7 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
     int i;
 
     ASSERT(isairq < NR_ISAIRQS);
-    if ( !vtd_enabled)
+    if ( !iommu_enabled)
         return;
 
     spin_lock(&d->event_lock);
index a47e863e1e4470e1fdb4d287519892e7b9123271..609d036979b5f6e38954b43445ae2cda1863fc1d 100644 (file)
@@ -26,7 +26,6 @@
 #include <public/hvm/ioreq.h>
 #include <public/domctl.h>
 
-extern int vtd_enabled;
 extern int iommu_enabled;
 extern int iommu_pv_enabled;
 extern int force_iommu;